package forum.server.domain;


import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class AdminTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void promoteModerator(){
		Admin admin = new Admin("test admin 1", "1234");
		LoggedInUser ru = new LoggedInUser("testSubject 0", "123abc");
		Moderator newModer = admin.promoteModerator(ru);
		Assert.assertTrue(newModer.getUsername().equals(ru.getUsername()));
	}
	
	@Test
	public void demoteModerator(){
		Admin admin = new Admin("test admin 1", "1234");
		Moderator newModer = new Moderator("test moderator", "1234");
		LoggedInUser ru = admin.demoteModerator(newModer);
		Assert.assertTrue(newModer.getUsername().equals(ru.getUsername()));
	}
}
